﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class ProfessionalKnowledgeTrainingMethodBL
	{

		#region ***** Init Methods ***** 
		ProfessionalKnowledgeTrainingMethodDA objProfessionalKnowledgeTrainingMethodDA;
		public ProfessionalKnowledgeTrainingMethodBL()
		{
			objProfessionalKnowledgeTrainingMethodDA = new ProfessionalKnowledgeTrainingMethodDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get ProfessionalKnowledgeTrainingMethod by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>ProfessionalKnowledgeTrainingMethod</returns>
		public ProfessionalKnowledgeTrainingMethod GetByID(int id)
		{
			return objProfessionalKnowledgeTrainingMethodDA.GetByID(id);
		}

		/// <summary>
		/// Get all of ProfessionalKnowledgeTrainingMethod
		/// </summary>
		/// <returns>List<<ProfessionalKnowledgeTrainingMethod>></returns>
		public List<ProfessionalKnowledgeTrainingMethod> GetList()
		{
			string cacheName = "lstProfessionalKnowledgeTrainingMethod";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeTrainingMethodDA.GetList(), "ProfessionalKnowledgeTrainingMethod");
			}
			return (List<ProfessionalKnowledgeTrainingMethod>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledgeTrainingMethod
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsProfessionalKnowledgeTrainingMethod";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeTrainingMethodDA.GetDataSet(), "ProfessionalKnowledgeTrainingMethod");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of ProfessionalKnowledgeTrainingMethod paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<ProfessionalKnowledgeTrainingMethod>></returns>
		public List<ProfessionalKnowledgeTrainingMethod> GetListPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeTrainingMethodDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledgeTrainingMethod paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeTrainingMethodDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new ProfessionalKnowledgeTrainingMethod within ProfessionalKnowledgeTrainingMethod database table
		/// </summary>
		/// <param name="obj_professionalknowledgetrainingmethod">ProfessionalKnowledgeTrainingMethod</param>
		/// <returns>key of table</returns>
		public int Add(ProfessionalKnowledgeTrainingMethod obj_professionalknowledgetrainingmethod)
		{
			ServerCache.Remove("ProfessionalKnowledgeTrainingMethod", true);
			return objProfessionalKnowledgeTrainingMethodDA.Add(obj_professionalknowledgetrainingmethod);
		}

		/// <summary>
		/// updates the specified ProfessionalKnowledgeTrainingMethod
		/// </summary>
		/// <param name="obj_professionalknowledgetrainingmethod">ProfessionalKnowledgeTrainingMethod</param>
		/// <returns></returns>
		public void Update(ProfessionalKnowledgeTrainingMethod obj_professionalknowledgetrainingmethod)
		{
			ServerCache.Remove("ProfessionalKnowledgeTrainingMethod", true);
			objProfessionalKnowledgeTrainingMethodDA.Update(obj_professionalknowledgetrainingmethod);
		}

		/// <summary>
		/// Delete the specified ProfessionalKnowledgeTrainingMethod
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("ProfessionalKnowledgeTrainingMethod", true);
			objProfessionalKnowledgeTrainingMethodDA.Delete(id);
		}
		#endregion
	}
}
